// pages/movie/movie.js
import { nowList,willList } from "../../utils/movie/index"
Page({

  go(e){
    this.setData({
      start:e.target.dataset.index
    })
    this.now()
  },
  
  data: {
    nowList:[],
    list:['正在热映','即将上映'],
    start:1,
    
  },
  now(){
    nowList({
      start:this.data.start+1,
      limit:15
    }).then((res)=>{
      console.log(res);
      this.setData({
        nowList:res.data.data.list
      })
      
    })
    console.log(this.data.nowList);
    
  },
will(){
  willList({
    start:2,
    limit:10
  }).then((res)=>{
    console.log(res);
    this.setData({
      willList:res.data.data.list
    })
    
  })
  console.log(this.data.willList);
},
  

now(){
  nowList({
    start:2,
    limit:15
  }).then((res)=>{
    console.log(res);
    this.setData({
      nowList:res.data.data.list
    })
    
  })
  console.log(this.data.nowList);
},
  onLoad: function (options) {
  this.now()
  },   
})